<script lang="ts" setup>
import { onMounted, ref } from 'vue';
import { defaultMenuOptions } from '@/types/components/menutree';
import { menutreeEmits, menutreeProps } from './menutree';
defineOptions({ name: 'WindowsMenutree' });
const props = defineProps(menutreeProps);
const emits = defineEmits(menutreeEmits);
const options = ref({});
const handleAppClick = (node: any) => {
  emits('app-click', node);
};
onMounted(() => {
  options.value = {
    ...defaultMenuOptions,
    ...props.menuOptions,
  };
});
</script>
<template>
  <el-menu v-bind="$attrs" active-text-color="#fff" background-color="none" class="el-menu-vertical-demo" text-color="#fff">
    <windows-menutree-item v-for="(item, index) in data" :key="index" :item="item" :menu-options="options" @app-click="handleAppClick" />
  </el-menu>
</template>

<style scoped lang="scss"></style>
